import { uniFetch  } from '../utils/Ajax'
import {uniConfig} from '../config/index'
const basePath = uniConfig.prodPath
export function getProduct(data : any) { 
    return uniFetch.uniGet({
            query: {
                ...data
            }
        },
        basePath + "/zt/wzry/product/detail"
    )
}
//套票商品信息
export function getCouponProduct(data : any) {
    return uniFetch.uniGet({
        query: {
            ...data
        }
        },
        basePath + "/zt/product/detail"
    )
}

//套票下单
export function buyCouponProduct(data : any) {
    return uniFetch.uniGet({
        query: {
            ...data
        }
        },
        basePath + "/zt/product/buy"
    )
}

//获取专题
export function getActive(data : any) {
    return uniFetch.uniGet({
        query: {
            ...data
        }
        },
        basePath + "/zt/get"
    )
}

//获取收货地址列表
export function getAddressList(data : any) {
    return uniFetch.uniPost({
        query: {
            ...data
        }
        },
        basePath + "/member/express/address/list"
    )
}

//删除地址
export function delAddress(data : any) {
    return uniFetch.uniPost({
        query: {
            ...data
        }
        },
        basePath + "/member/express/address/del"
    )
}

//保存地址
export function saveAddress(data : any) {
    return uniFetch.uniPost({
        query: {
            ...data
        }
        },
        basePath + "/member/express/address/save"
    )
}

//获取地址详细
export function getAddress(data : any) {
    return uniFetch.uniPost({
        query: {
            ...data
        }
        },
        basePath + "/member/express/address/get"
    )
}


//获取商城Banner
export function getBanner(data : any) {
    return uniFetch.uniGet({
        query: {
            ...data
        }
        },
        basePath + "/zt/wzry/advert/list"
    )
}
export function getProductList(data : any) {
	return uniFetch.uniGet({
	    query: {
	        ...data
	    }
	    },
	    basePath + "/zt/wzry/mall/product/list"
	)
}

//商城订单
export function getMallList(data : any) {
	return uniFetch.uniPost({
	    query: {
	        ...data
	    }
	    },
	    basePath + "/member/mall/order/list"
	)
}

//订单详情
export function getMallDetail(data : any) {
	return uniFetch.uniPost({
	    query: {
	        ...data
	    }
	    },
	    basePath + "/member/mall/order/detail"
	)
}

//获取购物车列表
export function getSkuCart(data : any) {
	return uniFetch.uniPost({
	    query: {
	        ...data
	    }
	    },
	    basePath + "/cartItem/list"
	)
}

//添加到购物车
export function addSkuCart(data : any) {
	return uniFetch.uniPost({
	    query: {
	        ...data
	    }
	    },
	    basePath + "/cartItem/add"
	)
}

//统计购物车内物品数量
export function getSkuCartCount(data : any) {
	return uniFetch.uniPost({
	    query: {
	        ...data
	    }
	    },
	    basePath + "/cartItem/count"
	)
}

//锁定购物车内需要支付的物品
export function sureSkuCartItem(data : any) {
	return uniFetch.uniPost({
	    query: {
	        ...data
	    }
	    },
	    basePath + "/mall/cart/topay/infoShow"
	)
}

//购物车内的商品打包创建订单
export function createSkuCartOrder(data : any) {
	return uniFetch.uniPost({
	    query: {
	        ...data
	    }
	    },
	    basePath + "/member/mall/order/create/byCart"
	)
}

//购物车内的商品打包创建订单
export function deleteSkuCartItem(data : any) {
	return uniFetch.uniPost({
	    query: {
	        ...data
	    }
	    },
	    basePath + "/cartItem/del"
	)
}

//获得商城分类
export function getCategory(data : any) {
	return uniFetch.uniGet({
	    query: {
	        ...data
	    }
	    },
	    basePath + "/zt/wzry/mall/category/list"
	)
}

